package cn.wolfcode.wolf2w.business.util;

import java.util.Calendar;
import java.util.Date;

public class DateUtil {

    /**
     * 获取当前时间的最后一分最后一秒
     * @param date
     * @return
     */
    public static Date getEndDate(Date date){
        Calendar instance = Calendar.getInstance();
        instance.setTime(date);
        instance.set(Calendar.HOUR_OF_DAY,23);
        instance.set(Calendar.MINUTE,59);
        instance.set(Calendar.SECOND,59);
        return instance.getTime();
    }

    public static Long getDateBetween(Date start, Date end){
        return Math.abs(start.getTime() - end.getTime()) / 1000;
    }
}
